import VueRouter from 'vue-router'
import Vue from 'vue'

// 显示声明使用VueRouter
Vue.use(VueRouter);

/* Layout */
import Layout from '@/layout'

// 路由表
const router = new VueRouter({
	mode: 'history',
  routes: [
    {
      // 路由路径
      path: '/',
      // 跳转目标组件
      component: Layout,
      // 重定向
      redirect: '/index',
      // 子组件
      children: [
        {
          path: 'index',
          component: () => import('@/views/customer/index'),
          name: 'Index',
          // meta: { title: 'Dashboard', icon: 'dashboard', affix: true }
        }
      ]
    },
		{
			path: '/chat',
			component: Layout,
			redirect: '/chat/index',
			children: [
			  {
			    path: 'index',
			    component: () => import('@/views/chat/index'),
			    name: 'Index',
			  }
			]
		},
		{
			path: '/tasks',
			component: Layout,
			redirect: '/tasks/index',
			children: [
			  {
			    path: 'index',
			    component: () => import('@/views/tasks/index'),
			    name: 'Index',
			  }
			]
		},
  ]
})

// 导出路由
export default router